
import * as types from './types'
import getters from './getters'
const state = {
  direction: 'forward',
  session: '',
  roleName: '',
  roleId: '',
  userName: '',
  activeName: 0,
  menuStyle: '',
};

const mutations = {
  [types.UPDATE_DIRECTION] (state, payload) {
    state.direction = payload.direction
  },
  [types.SESSION_DATA] (state, data) {
    state.session = data
  },
  [types.ROLE_NAME] (state, data) {
    state.roleName = data
  },
  [types.ROLE_ID] (state, data) {
    state.roleId = data
  },
  [types.USER_NAME] (state, data) {
    state.userName = data
  },
  [types.ACTIVE_NAME] (state, data) {
    state.activeName = data
  },
  [types.MENU_STY] (state, data) {
    state.menuStyle = data
  },
};

export default {
  state,
  mutations,
  getters
}
